package db;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by ZuoShu on 16/12/2.
 */
@Entity
@Table(name = "DayPlayerWin", schema = "", catalog = "")
public class DayPlayerWinEntity {
    private int autoId;
    private int roomId;
    private Integer systemWinScore;
    private int dayWinScore;
    private String data;
    private int setingWinScore;
    private int difference;

    @Basic
    @Column(name = "AutoID", nullable = false)
    public int getAutoId() {
        return autoId;
    }

    public void setAutoId(int autoId) {
        this.autoId = autoId;
    }

    @Basic
    @Column(name = "RoomID", nullable = false)
    public int getRoomId() {
        return roomId;
    }

    public void setRoomId(int roomId) {
        this.roomId = roomId;
    }

    @Basic
    @Column(name = "SystemWinScore", nullable = true)
    public Integer getSystemWinScore() {
        return systemWinScore;
    }

    public void setSystemWinScore(Integer systemWinScore) {
        this.systemWinScore = systemWinScore;
    }

    @Basic
    @Column(name = "DayWinScore", nullable = false)
    public int getDayWinScore() {
        return dayWinScore;
    }

    public void setDayWinScore(int dayWinScore) {
        this.dayWinScore = dayWinScore;
    }

    @Basic
    @Column(name = "Data", nullable = false, length = 0)
    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Basic
    @Column(name = "SetingWinScore", nullable = false)
    public int getSetingWinScore() {
        return setingWinScore;
    }

    public void setSetingWinScore(int setingWinScore) {
        this.setingWinScore = setingWinScore;
    }

    @Basic
    @Column(name = "Difference", nullable = false)
    public int getDifference() {
        return difference;
    }

    public void setDifference(int difference) {
        this.difference = difference;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DayPlayerWinEntity that = (DayPlayerWinEntity) o;

        if (autoId != that.autoId) return false;
        if (roomId != that.roomId) return false;
        if (dayWinScore != that.dayWinScore) return false;
        if (setingWinScore != that.setingWinScore) return false;
        if (difference != that.difference) return false;
        if (systemWinScore != null ? !systemWinScore.equals(that.systemWinScore) : that.systemWinScore != null)
            return false;
        if (data != null ? !data.equals(that.data) : that.data != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = autoId;
        result = 31 * result + roomId;
        result = 31 * result + (systemWinScore != null ? systemWinScore.hashCode() : 0);
        result = 31 * result + dayWinScore;
        result = 31 * result + (data != null ? data.hashCode() : 0);
        result = 31 * result + setingWinScore;
        result = 31 * result + difference;
        return result;
    }
}
